package com.vip.database.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.vip.database.dto.user.GetUserDTO;
import com.vip.database.entity.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 用户表 Mapper 接口
 *
 * @author LEON
 * @since 2020-04-05
 */
public interface SysUserMapper extends BaseMapper<SysUser> {
    /**
     * 获取用户列表
     *
     * @param account
     * @param name
     * @return
     */
    List<GetUserDTO> getUserList(@Param("account") String account, @Param("name") String name);

    /**
     * 判断账号是否已存在
     *
     * @param account
     * @return
     */
    boolean getUserIsExist(@Param("account") String account);

    /**
     * 获取用户详情
     *
     * @param id
     * @return
     */
    GetUserDTO selectUserDetails(@Param("id") String id);

    /**
     * 通过账户查询用户信息, 带权限
     *
     * @param account
     * @return
     */
    GetUserDTO findUserByAccountWithPerm(@Param("account") String account);

    /**
     * 通过账户查询用户基本信息
     *
     * @param account
     * @return
     */
    GetUserDTO findUserBaseInfoByAccount(String account);
}
